Conditions | 1 |
Paths | 1 |
Total Lines | 52 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | var assert = require('chai').assert, |
||
68 | it('Build', function(){ |
||
69 | tests(GedcomX.AtomEntry() |
||
70 | .addAuthor( |
||
71 | GedcomX.AtomPerson() |
||
72 | .setName('author') |
||
73 | .setEmail('[email protected]') |
||
74 | ) |
||
75 | .addContributor( |
||
76 | GedcomX.AtomPerson() |
||
77 | .setName('contributor') |
||
78 | .setEmail('[email protected]') |
||
79 | ) |
||
80 | .addCategory( |
||
81 | GedcomX.AtomCategory() |
||
82 | .setScheme('scheme') |
||
83 | .setTerm('term') |
||
84 | .setLabel('label') |
||
85 | ) |
||
86 | .setGenerator( |
||
87 | GedcomX.AtomGenerator() |
||
88 | .setUri('uri') |
||
89 | .setVersion('version') |
||
90 | .setValue('value') |
||
91 | ) |
||
92 | .setIcon('icon') |
||
93 | .setId('id') |
||
94 | .addLink( |
||
95 | GedcomX.Link() |
||
96 | .setRel('rel') |
||
97 | .setHref('href') |
||
98 | ) |
||
99 | .setLogo('logo') |
||
100 | .setRights('rights') |
||
101 | .setSubtitle('subtitle') |
||
102 | .setTitle('title') |
||
103 | .setUpdated(123456789) |
||
104 | .setConfidence(4) |
||
105 | .setPublished(123456780) |
||
106 | .setSummary('summary') |
||
107 | .setScore(122.32) |
||
108 | .setContent({ |
||
109 | gedcomx: { |
||
110 | description: '#root' |
||
111 | } |
||
112 | }) |
||
113 | .setSource({ |
||
114 | logo: 'logo', |
||
115 | rights: 'rights', |
||
116 | subtitle: 'subtitle' |
||
117 | }) |
||
118 | ); |
||
119 | }); |
||
120 | |||
176 | } |